<p-panel header="筛选查询" [collapsed]="false" headerClass="bg-eaeaea border-none" headerClass="bg-eaeaea border-none" search="责任人姓名/项目编号"
    (onSearch)="search($event)" (searchTextChange)="searchTextChange($event);">
    <div class="p-b-20 border-b-d9d9d9">
        <p-selectButton [canDelete]="true" [options]="statusArr" (onChange)="search()" optionLabel="name" [(ngModel)]="selectedObj.status"></p-selectButton>
    </div>
    <div class="p-t-20">
        <div class="m-r-15 inline-block">
            <span class="p-r-10">组织名称：</span>
            <p-dropdown [justValue]="true" dataKey="code" optionLabel="name" styleClass="width-150" [options]="organizationArr" placeholder="全部"
                [(ngModel)]="searchObj.organizationCode"></p-dropdown>
        </div>
        <!-- <div class="m-r-15 inline-block">
                          <span class="p-r-10">服务商: </span>
                          <p-dropdown [justValue]="true" dataKey="code" optionLabel="name" styleClass="width-150" [options]="cities4" placeholder="请选择" [(ngModel)]="searchObj.departmentCode"></p-dropdown>
                     </div>  -->

        <div class="m-r-15 inline-block">
            <span class="p-r-10">处罚类型：</span>
            <p-dropdown [justValue]="true" dataKey="code" optionLabel="name" styleClass="width-150" [options]="punishTypeArr" placeholder="全部"
                [(ngModel)]="searchObj.punishType"></p-dropdown>
        </div>

        <div class="inline-block pull-right">
            <button pButton type="button" (click)="search()" label="查询" class="btn btn-success m-r-10"></button>
        </div>
    </div>

</p-panel>


<p-dataTable [value]="listData" [totalRecords]="totalRecords" [marginHeight]="20"  scrollable="true" [lazy]="true" (onLazyLoad)="loadCarsLazy($event)"
    [paginator]="true" [(selection)]="selectedItem" [headerCheckboxToggleAllPages]="true">
    <p-header>
    </p-header>
    <p-column *ngFor="let col of colsSelected" [field]='col.field' [header]='col.header' [sortable]="col.sortable" [style]="{'width':col.width}">
        <ng-template let-index='rowIndex' let-data='rowData' pTemplate='body' *ngIf="col.tem">
            <div *ngIf="col.field === 'sortNum'">
                {{index+1}}
            </div>
            <div *ngIf="col.field === 'code'" style="color:#1a91eb;cursor:pointer;">
                <a class="color-1a91eb" title="{{data.code}} " target="_blank" [routerLink]="['/saas/engineer/punishrecordmanage/punishrecord/', data.code]">{{data.code}} </a>
            </div>
          <div *ngIf="col.field == 'createName'">{{data[col.field]}} &nbsp; {{storage.dicFilter(col.dic,data['userType'])}} </div>
          <div *ngIf="col.field == 'responsibilitierName'">{{data[col.field]}} &nbsp; {{storage.dicFilter(col.dic,data['responsibilitierType'])}} </div>
            <div *ngIf="col.field === 'organizationCode'">
                {{storage.orgFilter(data[col.field])}}
            </div>
            <div *ngIf="col.field === 'punishType'">
                {{storage.dicFilter('punishtype',data[col.field])}}
            </div>
            <div *ngIf="col.field === 'status'">
                {{storage.dicFilter('penaltyStatus',data[col.field])}}
            </div>
        </ng-template>
    </p-column>
</p-dataTable>
